<?php
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
	$_GET = stripAllSlashes($_GET);
	$_POST = stripAllSlashes($_POST);
	$_COOKIE = stripAllSlashes($_COOKIE);
	$_FILES = stripAllSlashes($_FILES);
}
function stripAllSlashes($data) {
	if (is_array($data)) {
		foreach ($data as $key => $val) {
			unset($data[$key]);
			$data[stripslashes($key)] = stripAllSlashes($val);
		}
	} else {
		$data = stripslashes($data);
	}
	return $data;
}

defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/..'));
//Define application environment, default: production
defined('APPLICATION_ENV') || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
//Ensure Zend Framework is in include_path
require_once APPLICATION_PATH . '/configs/includeZend.php';
require_once APPLICATION_PATH . '/configs/SiteConfig.php';

// Create application, bootstrap, and run
require_once 'Zend/Application.php';
$application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/web.ini');
$application->bootstrap()->run();
